import {NgModule} from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {AuthGuard} from "../../service/authGuard";

import {RiskCheckComponent} from "./risk-check/risk-check.component";
import {RiskCheckDetailComponent} from "./risk-check-detail/risk-check-detail.component";
import {RiskCheckDimensionComponent} from "./risk-check-dimension/risk-check-dimension.component";

const routes: Routes = [
    {path: "", redirectTo: "list", pathMatch: "full"},
    {
      path: "list",
      component: RiskCheckComponent,
      canActivate: [AuthGuard],
      data: {
        title: 'RiskCheck'
      }
    },
    {
      path: ":id/detail",
      component: RiskCheckDetailComponent,
      canActivate: [AuthGuard],
      data: {
        title: 'RiskCheckDetail'
      }
    },
    {
      path: ":id/detail/scan/:code",
      component: RiskCheckDetailComponent,
      canActivate: [AuthGuard],
      data: {
        title: 'RiskCheckDetail'
      }
    },
    // {
    //   path: "scan",
    //   component: RiskCheckScanComponent,
    //   canActivate: [AuthGuard],
    //   data: {
    //     title: 'RiskCheckScan'
    //   }
    // },
    {
      path: ":code/qrTaskList",
      component: RiskCheckDimensionComponent,
      canActivate: [AuthGuard],
      data: {
        title: 'RiskCheckDimension'
      }
    }

];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class RiskBoardRoutes {
}
